<!DOCTYPE html>
<html>
<head>
    <title>控制台</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/font-awesome.min.css">
    <link rel="stylesheet" href="plugins/jqgrid/ui.jqgrid-bootstrap.css">
    <link rel="stylesheet" href="css/main.css">
    <script src="libs/jquery.min.js"></script>
    <script src="plugins/layer/layer.js"></script>
    <script src="libs/bootstrap.min.js"></script>
    <script src="libs/vue.min.js"></script>
    <script src="plugins/jqgrid/grid.locale-cn.js"></script>
    <script src="plugins/jqgrid/jquery.jqGrid.min.js"></script>
    <script src="js/common.js"></script>
    <style>
        .control-label {
            font-weight: 400;
        }

        .form-control {
            margin-right: 10px;
        }

        .row {
            border-top: none;
            margin: 0;
            padding: 0;
        }
    </style>
</head>
<body>
<div id="rrapp">
    <div class="panel panel-default">
        <div class="panel-heading">配置数据库</div>
        <div class="panel-body">
            <form class="form-inline" action="#">
                <div class="form-group">
                    <label for="jdbcUrl" class="control-label">数据库地址</label>
                    <input type="text" size="75" class="form-control" v-model="datasource.url" id="jdbcUrl" value=""
                           placeholder="...">
                </div>
                <div class="form-group">
                    <label for="jdbcUsername" class="control-label">账号</label>
                    <input type="text" class="form-control" v-model="datasource.username" id="jdbcUsername"
                           placeholder="...">
                </div>
                <div class="form-group">
                    <label for="jdbcPassword" class="control-label">密码</label>
                    <input type="text" class="form-control" v-model="datasource.password" id="jdbcPassword"
                           placeholder="...">
                </div>
                <div class="form-group">
                    <a class="btn btn-info" @click="dataSourcePing">连接测试</a>
                </div>
                <div class="form-group">
                    <a class="btn btn-default" @click="resetDataSource">重置</a>
                </div>
            </form>
        </div>
    </div>

    <div class="panel panel-default">
        <div class="panel-heading">生成代码</div>
        <div class="panel-body">
            <div class="row" style="padding-bottom: 10px;">
                <div style="float: left">
                    <form class="form-inline" action="#">
                        <div class="form-group">
                            <label for="inputAuthor" class="control-label">作者</label>
                            <input type="text" class="form-control" size="12" id="inputAuthor"
                                   v-model="projetModel.author"
                                   placeholder="...">
                        </div>
                        <div class="form-group">
                            <label for="inputEmail" class="control-label">邮箱</label>
                            <input type="email" class="form-control" id="inputEmail" v-model="projetModel.email"
                                   placeholder="...">
                        </div>
                        <div class="form-group">
                            <label for="inputTablePrefix" class="control-label">表前缀</label>
                            <input type="text" class="form-control" size="8" id="inputTablePrefix"
                                   v-model="projetModel.tablePrefix"
                                   placeholder="...">
                        </div>

                        <div class="form-group">
                            <label for="inputPackage" class="control-label">基础包路径</label>
                            <input type="text" class="form-control" id="inputPackage" v-model="projetModel.basePackage"
                                   placeholder="...">
                        </div>
                        <div class="form-group">
                            <label for="inputModuleName" class="control-label">模块名</label>
                            <input type="text" class="form-control" size="12" id="inputModuleName"
                                   v-model="projetModel.moduleName"
                                   placeholder="...">
                        </div>
                        <div class="form-group">
                            <a class="btn btn-info" @click="saveProjectModel">保存</a>
                        </div>
                        <div class="form-group">
                            <a class="btn btn-default" @click="resetProjectModel">重置</a>
                        </div>
                    </form>
                </div>
                <div style="float: right">
                    <form class="form-inline" action="#">
                        <div class="input-group">
                            <input type="text" class="form-control" size="12" id="inputTableName"
                                   v-model="search.tableName"
                                   @keyup.enter="query" placeholder="请输入表名...">
                            <span class="input-group-btn">
                            <button class="btn btn-default" type="button" @click="query">查询</button>
                        </span>
                        </div>
                        <a class="btn btn-success" @click="generatorCode"><i class="fa fa-file-code-o"></i>&nbsp;生成代码</a>
                        <a class="btn btn-primary" @click="generatorWord"><i class="fa fa-file-code-o"></i>&nbsp;生成文档</a>
                    </form>
                </div>
            </div>
            <!-- 表格 -->
            <div style="width: 100%;">
                <table id="jqGrid"></table>
            </div>
            <!-- 分页 -->
            <div id="jqGridPager"></div>
        </div>
    </div>
</div>
<script src="js/code.js"></script>
</body>
</html>